@use '../mdc-theming/all-theme';
@use '../../material/core/theming/theming';

@mixin all-mdc-component-densities($config-or-theme) {
  // In case a theme object has been passed instead of a configuration for
  // the density system, extract the density config from the theme object.
  $config: if(theming.private-is-theme-object($config-or-theme),
      theming.get-density-config($config-or-theme), $config-or-theme);

  @if $config == null {
    @error 'No density configuration specified.';
  }

  @include all-theme.all-mdc-component-themes((
    color: null,
    typography: null,
    density: $config,
  ));
}

// @deprecated Use `all-mdc-component-densities`.
@mixin angular-material-mdc-density($config-or-theme) {
  @include all-mdc-component-densities($config-or-theme);
}
